import views.LogInFrame;

import javax.swing.*;
import javax.swing.plaf.FontUIResource;
import java.awt.*;
import java.util.Enumeration;

public class Main {
    /*** 统一设置字体，父界面设置之后，所有由父界面进入的子界面都不需要再次设置字体*/
    private static void InitGlobalFont(Font font) {
        FontUIResource fontRes = new FontUIResource(font);
        for (Enumeration<Object> keys = UIManager.getDefaults().keys(); keys.hasMoreElements(); ) {
            Object key = keys.nextElement();
            Object value = UIManager.get(key);
            if (value instanceof FontUIResource) {
                UIManager.put(key, fontRes);
            }
        }
    }

    public static void main(String[] args) {
        try {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());//当前系统风格
        } catch (Exception e) {
            e.printStackTrace();
        }
        InitGlobalFont(new Font("HarmonyOS Sans SC Medium", Font.PLAIN, 12));
        new LogInFrame().setVisible(true);
    }
}
